/**
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

@import '../../../styles/variables';

.forbiddenPopup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.125s ease-in-out;

  &::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    transition: opacity 0.25s ease-in-out;
    opacity: 0;
    z-index: -1;
  }

  &.show {
    opacity: 1;

    &::after {
      opacity: 1;
    }
  }

  .whoops {
    width: 48px;
    height: 48px;
    position: absolute;
    bottom: calc(100% + 16px);
    left: 50%;
    transform: translate3d(-50%, 100%, 0px);
    transition: transform 0.25s cubic-bezier(0.21, 0.35, 0.24, 1.11) 0.25s,
      opacity 0.25s ease-out 0.25s;
    display: flex;
    flex-flow: column;
    justify-content: center;
    align-items: center;
    font-size: 30px;
    font-weight: 700;
    padding-right: 4px;
    z-index: -1;
    opacity: 0;
    font-family: 'Noto Color Emoji';

    @media screen and (min-width: $desktop) {
      font-size: 50px;
      width: 80px;
      height: 80px;
    }
  }

  &.show {
    .whoops {
      transform: translate3d(-50%, 0%, 0px);
      opacity: 1;
    }

    @for $i from 1 through 10 {
      mark:nth-child(#{$i}) {
        .whoops {
          transition-delay: #{$i * 0.05}s;
        }
      }
    }
  }

  &.hide {
    opacity: 0;
    transition: opacity 0.25s 0.25s;

    .whoops {
      transform: translate3d(-50%, 100%, 0px);
      transition-duration: 0.4s;
      transition-timing-function: cubic-bezier(.82,-0.41,.71,.94);
    }

    @for $i from 1 through 10 {
      mark:nth-child(#{$i}) {
        .whoops {
          transition-delay: #{$i * 0.05}s;
        }
      }
    }
  }

  mark {
    position: absolute;
    font-size: 18px;
    line-height: 27px;
    font-weight: 400;
    letter-spacing: -0.05em;

    top: 0;
    left: 0;

    @media screen and (min-width: $desktop) {
      font-size: 36px;
      line-height: 54px;
    }
  }
}
